package me.maven.plugin.remotejar.config;

import java.util.Objects;

/**
 * @author langle__
 * @version 1.0
 */
public class HostPort {

    private final String host;
    private final Integer port;
    private final String password;

    public HostPort(String host, Integer port, String password) {
        this.host = host;
        this.port = port;
        this.password = password;
    }

    public String getHost() {
        return host;
    }

    public Integer getPort() {
        return port;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof HostPort)) return false;
        HostPort hostPort = (HostPort) o;
        return Objects.equals(getHost(), hostPort.getHost()) && Objects.equals(getPort(), hostPort.getPort()) && Objects.equals(getPassword(), hostPort.getPassword());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getHost(), getPort(), getPassword());
    }

    @Override
    public String toString() {
        return "HostPort{" +
                "host='" + host + '\'' +
                ", port=" + port +
                ", password='" + password + '\'' +
                '}';
    }

}
